//1.npm init
//2.npm i socket.io -D
const http = require('http');
const io = require('socket.io');

let server = http.createServer();
server.listen(8080);
let wsServer = io.listen(server);

ws.on('connection', sock => {
    sock.on('msg', data => {
        console.log(data)
    })
})
